﻿@model www.Models.CategoryTypeModels
@{
    ViewBag.Title = "Thêm mới Tin tức | Truyện | Hình ảnh";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
   
}
<script type="text/javascript" src="@Url.Content("~/fckEditor/fckeditor.js")"></script>

<script type="text/javascript">
    window.onload = function () {
        var sBasePath = '@Url.Content("~/fckeditor/")';
        var oFCKeditor = new FCKeditor('txtdetail');
        oFCKeditor.BasePath = sBasePath;
        oFCKeditor.Height = 350;
        oFCKeditor.ReplaceTextarea();

        $('#RelaxType').change(function () {

            $.ajax({
                type: "POST",
                url: '@Url.Action("LoadType", "Story")',
                data: { type: $('#RelaxType > option:selected').attr('value') },
                success: function (data) {
                    var items = [];
                    //items.push("<option>--Choose Your Area--</option>");
                    $.each(data, function () {
                        items.push("<option value=" + this.Value + ">" + this.Text + "</option>");
                    });
                    $('#RelaxCategory').html(items.join(' '));
                }
            });
        });

        $(".datefield").datepicker();
    }
</script>

<div class="content">
    <fieldset style="width: 99%; height: auto; overflow: hidden; border: 1px solid #008080;">
        <legend>Thêm mới danh mục</legend>
        <div class="clear"></div>

        @using (Html.BeginForm("Add", "Story", FormMethod.Post, new { id = "frmAdd", enctype = "multipart/form-data" }))
        {
            <div class="row">
                <div class="col-left">Thể loại</div>
                <div class="col-right">
                    @Html.DropDownList("RelaxType", new SelectList(Model.RelaxType, "Id", "Name"), new { @class = "combobox" })
                </div>
            </div>
            <div class="row">
                <div class="col-left">Danh mục</div>
                <div class="col-right">
                    @Html.DropDownList("RelaxCategory", new SelectList(Model.RelaxCategory, "Id", "Name"), new { @class = "combobox" })
                </div>
            </div>
            
            <div class="row">
                <div class="col-left">Tiêu đề</div>
                <div class="col-right">@Html.TextBox("txtName", null, new { @class = "textbox" })
                    <span class="red">*</span>
                </div>
            </div>
            <div class="row">
                <div class="col-left">Hình ảnh</div>
                <div class="col-right">
                    <input type="file" name="fufile" id="fufile" style="width: 100%;" /><span class="red">*</span>
                </div>
            </div>
            <div class="row">
                <div class="col-left">Liên kết</div>
                <div class="col-right">@Html.TextBox("txtLink", null, new { @class = "textbox" })</div>
            </div>
            <div class="row">
                <div class="col-left">Kiểu liên kết</div>
                <div class="col-right">@Html.DropDownList("LinkType", new SelectList((List<SelectListItem>)Session["LinkType"], "Value", "Text"), new { @class = "combobox" })</div>
            </div>
            <div class="row">
                <div class="col-left">Từ khóa</div>
                <div class="col-right">@Html.TextBox("txtKeyword", null, new { @class = "textbox" })<span class="red">*</span></div>
            </div>
            <div class="decription">
                <div class="col-left">Mô tả</div>
                <div class="col-right">@Html.TextArea("txtDecription", null, new { @class = "textarea" })<span class="red">*</span></div>
            </div>
            <div class="row">
                <div class="col-left">Thứ tự ưu tiên</div>
                <div class="col-right">@Html.TextBox("txtPriority", null, new { @class = "textbox", onkeyup = "javascript:checkNumber(this);" })</div>
            </div>
            <div class="detail">
                <div class="col-left">Chi tiết</div>
                <div class="col-right">@Html.TextArea("txtdetail", new { @class = "textarea2" })</div>
            </div>
            <div class="row">
                <div class="col-left">Ngày Đăng</div>
                <div class="col-right">@Html.TextBox("txtDate", null, new { @class = "datefield" })</div>
            </div>
           
            <div class="row">
                <div class="col-left">Mặc định</div>
                <div class="col-right">@Html.CheckBox("chkisDefault")</div>
            </div>
            <div class="row">
                <div class="col-left">Trạng thái</div>
                <div class="col-right">@Html.CheckBox("chkActive")</div>
            </div>
            <div class="row">
                <div class="col-left"></div>
                <div class="col-right">
                    <input type="submit" id="Submit1" class="button" name="submit1" value="Thêm mới" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@Html.ActionLink("Quay lại", "Index", "Advertise")
                </div>
            </div>
        }

    </fieldset>
</div>

@*@Scripts.Render("~/bundles/jqueryui")
@section Scripts{
    
    <script type="text/javascript">
        $(document).ready(function () {
            $("#txtDate").datepicker();
        });
    </script>
}*@
